package com.hospital.service.publics.model.param;


import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hospital.service.publics.entity.PubUserInfo;
import com.hospital.service.publics.entity.help.PubUserInfoHelp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import enhance.plus.util.MybatisPlusUtil;
import enhance.plus.util.PageHelper;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 用户信息表 新增参数
 *
 * @author lfb
 * @created 2020-11-08 11:02:40
 */
@Data
@ToString
@Accessors(chain = true)
@ApiModel(value="PubUserInfo[用户信息表]分页查询")
public class PubUserInfoQueryPageParam extends PageHelper{

    /**
    * ID
    */
    @ApiModelProperty(value = "ID", required = false , example = "")
    private String id;

    /**
     * 编号
     */
    @ApiModelProperty(value = "编号", required = false , example = "")
    private String userNumber;

    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名", required = false , example = "")
    private String userName;

    /**
     * 电话号码
     */
    @ApiModelProperty(value = "电话号码", required = false , example = "")
    private String phone;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱", required = false , example = "")
    private String email;

    /**
     * 单位
     */
    @ApiModelProperty(value = "单位", required = false , example = "")
    private String company;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注", required = false , example = "")
    private String remarks;

    /**
     * 科室
     */
    @ApiModelProperty(value = "科室", required = false , example = "")
    private String department;

    /**
     * 导师
     */
    @ApiModelProperty(value = "导师", required = false , example = "")
    private String tutor;

    /**
     * 导师联系电话
     */
    @ApiModelProperty(value = "导师联系电话", required = false , example = "")
    private String tutorPhone;

    /**
     * 导师联系邮箱
     */
    @ApiModelProperty(value = "导师联系邮箱", required = false , example = "")
    private String tutorEmail;

    /**
    * 把非 null 的值 转换成一个 查询条件
    * @return
    */
    public QueryWrapper<PubUserInfo> convertParamToQueryWapper(){
        QueryWrapper<PubUserInfo> query = PubUserInfoHelp.createQuery();
        Map<String, Object> result =  MybatisPlusUtil.convertParamToMap(this, PubUserInfo.class);
        query.allEq(result);
        return query;
    }
}
